package edu.qqilin.springframework.test.common;

import edu.qqilin.springframework.beans.BeansException;
import edu.qqilin.springframework.beans.PropertyValue;
import edu.qqilin.springframework.beans.PropertyValues;
import edu.qqilin.springframework.beans.factory.ConfigurableListableBeanFactory;
import edu.qqilin.springframework.beans.factory.config.BeanDefinition;
import edu.qqilin.springframework.beans.factory.config.BeanFactoryPostProcessor;

/**
 * Description: new java files header..
 *
 * @author qqilin1213
 * @version 1.0
 * @date 2025/11/24 20:59
 */
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

        BeanDefinition beanDefinition = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = beanDefinition.getPropertyValues();

        propertyValues.addPropertyValue(new PropertyValue("company", "改为：字节跳动"));
    }
}
